<div>
	<form method="post" id="form_${action_id}" name="form_${action_id}" >
	<input type="hidden" name="entity.agency.id" id="entity.agency.id" value="${id?default('')}" />
    <table class="form-table" cellpadding=3>
    	<tr>
    		<td>
    			<table>
			        <tr>
			            <td>${action.getDatagridTitle('name')}:</td>
			            <td><input id="entity.name" name="entity.name" type="text" style="width: 200px;" class="easyui-validatebox" data-options="required:true,validType:'length[0,64]'"   /></td>
			        </tr>
			        <tr>
			            <td>${action.getDatagridTitle('password')}:</td>
			            <td><input id="entity.password" name="entity.password" type="password" style="width: 200px;" class="easyui-validatebox" data-options="required:true,validType:'length[0,32]'"   /></td>
			        </tr>
			        <tr>
			            <td>${action.getDatagridTitle('subName')}:</td>
			            <td><input id="entity.subName" type="text" style="width:200px;" name="entity.subName"  class="easyui-validatebox" data-options="validType:'length[0,64]'"   ></input></td>
			        </tr>
			        <tr>
			            <td>${action.getDatagridTitle('address')}:</td>
			            <td><input id="entity.address" type="text" style="width:200px;" name="entity.address"  class="easyui-validatebox" data-options="validType:'length[0,500]'"   ></input></td>
			        </tr>
			        <tr>
			            <td>${action.getDatagridTitle('mobile')}:</td>
			            <td><input id="entity.mobile" type="text" style="width:200px;" name="entity.mobile"  class="easyui-validatebox" data-options="validType:'length[0,20]'" ></input></td>
			        </tr>
			        <tr>
			            <td>${action.getDatagridTitle('linkPhone')}:</td>
			            <td><input id="entity.linkPhone" type="text" style="width:200px;" name="entity.linkPhone"  class="easyui-validatebox" data-options="validType:'length[0,32]'" ></input></td>
			        </tr>
			        <tr>
			            <td>${action.getDatagridTitle('state')}:</td>
			            <td>
			            	<select id="entity.state" name="entity.state"  class="easyui-combobox" data-options="required:true" >
			            		<#list states as state>
			            		<option value="${state.state}">${action.getDatagridTitle('state.'+state.name())}</option>
			            		</#list>
			            	</select>
			            </td>
			        </tr>
    			</table>
    		</td>
    		<td>
    			<#list groups as group >
    				<input type="checkbox" value="${group.id}" name="groups" />${group.name?default('')}<br/>
    			</#list>
    		</td>
    	</tr>
    </table>
	</form>
</div>
<script type="text/javascript">
	function use_mta_auth_${action_id}(index){
		var type = $("#useMatAuth_${action_id}").val();
		var obj = document.getElementsByName("use_mta_auth_${action_id}_"+index);
		var t="";
		if(obj[0].checked){
			for(var i=0;i<type.length;i++){
				if(i==index-1){
					t = t + 1;		
				}else{
					t = t + type.charAt(i);
				}
			}			
		}else{
			for(var i=0;i<type.length;i++){
				if(i==index-1){
					t = t + 0;		
				}else{
					t = t + type.charAt(i);
				}
			}
		}
		$("#useMatAuth_${action_id}").val(t);
	}
</script>